<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/10/29
  Time: 10:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<button onclick="qingqiu()">ajax请求后台</button>

<div></div>



</body>

<script src="${pageContext.request.contextPath}/js/jquery-1.12.4.min.js"></script>
<script>
    //点击按钮, 悄悄的像后台发送请求, 获取后台返回的数据
    
    function qingqiu() {
        $.ajax( {
            url: "${pageContext.request.contextPath}/demo1",
            method: "get",

            success:function (result) {
                //alert(result)
                $("div").html(result)
            }
        } )
    }
</script>
</html>
